package com.caigou.modules.tools.widget

import android.app.Dialog
import android.content.Context
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.view.Window
import android.widget.ImageView
import android.widget.TextView
import com.caigou.modules.tools.R

/**
 * @author #Suyghur.
 * Created on 2021/12/07
 */
class SignInDialog(private val flowerNum: Int, context: Context) : Dialog(context) {

    private lateinit var tvNum: TextView
    private lateinit var ivClose: ImageView

    init {
        setCanceledOnTouchOutside(true)
        window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
        requestWindowFeature(Window.FEATURE_NO_TITLE)
        initView()
    }

    private fun initView() {
        setContentView(R.layout.dialog_sign_in)

        tvNum = findViewById(R.id.sign_in_dialog_tv_num)
        tvNum.text = "${flowerNum}朵"
        ivClose = findViewById(R.id.sign_in_dialog_iv_close)
        ivClose.setOnClickListener {
            this.dismiss()
        }
    }
}